package com.worthtech.billportal.dao.hibernate;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.worthtech.billportal.bean.Role;
import com.worthtech.billportal.dao.RoleDAO;

public class RoleHibernateDAO extends HibernateDaoSupport implements RoleDAO {

	public List getRoleList() {
		return this.getHibernateTemplate().find("from Role ");
	}

	public Role getRole(int id) {
		return (Role)this.getHibernateTemplate().get(Role.class,new Integer(id));
	}

	public Role save(Role role) {
		this.getHibernateTemplate().saveOrUpdate(role);
		return role;
	}

}
